public class Custom extends Thread{

    MyStack<Character> stack ;
    public Custom(MyStack<Character> stack,String name){
        super(name);
        this.stack = stack;

    }

    public void run(){
        while(true) {
            char c = stack.pull();
            System.out.println(this.getName() + "弹出：" + c);
            try {
                Thread.sleep(100);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }

    }

}
